package com.lz.demo8;

/**
 * @ClassName TestStudnet
 * @Description 测试
 * @Author 2214361854
 * @Date 2022/5/28 15:03
 * @Version 1.0
 */
public class TestStudnet {
    public static void main(String[] args) {
        //1.1使用无参构造创建对象
        Student s = new Student();
        //1.2通过setXxx()给对象的所有属性赋值
        s.setId(1);
        s.setName("林冲");
        s.setGender('男');
        s.setSubject("CGB");
        s.setAddress("庙里");
        //1.3通过对象调用方法测试
        s.study();
        s.eat(3);
        System.out.println(s.sleep());
        s.show();//Student:[id=1,name=林冲,gender=男,address=庙里,subject=CGB]

        //2.1使用全参构造创建对象
        Student s2 = new Student(2, "李逵", '男', "猪肉铺", "ACT");
        s2.study();
        s2.eat(10);
        System.out.println(s2.sleep());
        s2.show();
    }
}
